#pragma once

#include "OpenGLTools.hpp"
#include <Math/Vector3.hpp>

namespace zzz{
template <typename T>
class Translation : public Vector<3,T>
{
  using Vector<3,T>::v;
public:
  Translation():Vector<3,T>(0){}
  Translation(const Translation<T> &other):Vector<3,T>(other.v){}
  Translation(const T x, const T y, const T z):Vector<3,T>(x,y,z){}
  explicit Translation(const VectorBase<3,T> &other):Vector<3,T>(other){}

  using Vector<3,T>::operator=;

  VectorBase<3,T> Apply(const VectorBase<3,T>& other) const
  {
    return other+(*this);
  }

// Make it unable to compile
  inline void ApplyGL() const;
//   {
//     cerr<<"Cannot apply for this type\n";
//   }
};
template<>
void Translation<float>::ApplyGL() const
{
  glTranslatef(v[0],v[1],v[2]);
}
template<>
void Translation<double>::ApplyGL() const
{
  glTranslated(v[0],v[1],v[2]);
}

typedef Translation<zfloat32> Translationf32;
typedef Translation<zfloat64> Translationf64;


typedef Translation<float> Translationf;
typedef Translation<double> Translationd;
}
